//package com.lagou.dao;
//
//import com.lagou.io.Resources;
//import com.lagou.pojo.User;
//import com.lagou.sqlSession.SqlSession;
//import com.lagou.sqlSession.SqlSessionFactory;
//import com.lagou.sqlSession.SqlSessionFactoryBuilder;
//
//import java.io.InputStream;
//import java.util.List;
//
//public class UserDaoImpl implements IUserDao {
//    @Override
//    public List<User> findAll() throws  Exception{
//        InputStream resourceAsSteam = Resources.getResourceAsSteam("sqlMapConfig.xml");
//        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsSteam);
//        SqlSession sqlSession = sqlSessionFactory.openSession();
//
//        List<User> users = sqlSession.selectList("user.selectList");
//        for (User user1 : users) {
//            System.out.println(user1);
//        }
//        return  users;
//    }
//
//    @Override
//    public User findByCondition(User user) throws  Exception{
//        InputStream resourceAsSteam = Resources.getResourceAsSteam("sqlMapConfig.xml");
//        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsSteam);
//        SqlSession sqlSession = sqlSessionFactory.openSession();
//
//
//        User user2 = sqlSession.selectOne("user.selectList",user);
//        System.out.println(user2);
//        return  user2;
//    }
//
//
//
//
//}
